package com.xishu.entity.hardware;

import com.xishu.annotation.dao.FieldMapping;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.List;

/**
 * 打印失败的结果列表
 *
 * 整体思路，将发送给打印机的字符串保存下来
 * 然后根据具体的类型来判断怎么处理
 * 1、如果有touchUuid，那么在选择新的打印机的时候，会做切换打印。
 * 2、如果是发送到厨房，那么在标签切换的时候 ，会做切换打印。
 * 3、如果还是打印小票，那么在管理
 *
 *
 *
 */
@Entity(name = "printer_failed_result")
@Table(indexes = {@Index(columnList = "shopId"), @Index(columnList = "printerId")})
public class PrinterFailedResult extends AbstractEntity {
    @ApiModelProperty(value = "打印机的id")
    private Long printerId;

    @ApiModelProperty(value = "前端触摸屏的UUID")
    private String touchUuid;

    @ApiModelProperty(value = "打印机类型, 1、厨房打印 2、B端服务员的小票打印，或者是排队打印 3、C端落单之后的，小票打印")
    private Long printType;

    @ApiModelProperty(value = "分店ID")
    private Long shopId;

    @ApiModelProperty(value = "打印的详细数据")
    @Lob
    @Column(columnDefinition="MEDIUMTEXT")
    private String printDetailJson;

    @ApiModelProperty(value = "关联的标签")
    @Lob
    @Column(columnDefinition="MEDIUMTEXT")
    @FieldMapping(desField = "labelList", serialize = false, genericType = "java.lang.String")
    private String labelJson;

    @ApiModelProperty(value = "关联的标签")
    @FieldMapping(desField = "labelJson", serialize = true)
    @Transient
    private List<String> labelList;

    public String getLabelJson() {
        return labelJson;
    }

    public void setLabelJson(String labelJson) {
        this.labelJson = labelJson;
    }

    public List<String> getLabelList() {
        return labelList;
    }

    public void setLabelList(List<String> labelList) {
        this.labelList = labelList;
    }

    public String getPrintDetailJson() {
        return printDetailJson;
    }

    public void setPrintDetailJson(String printDetailJson) {
        this.printDetailJson = printDetailJson;
    }

    public String getTouchUuid() {
        return touchUuid;
    }

    public void setTouchUuid(String touchUuid) {
        this.touchUuid = touchUuid;
    }

    public Long getPrinterId() {
        return printerId;
    }

    public void setPrinterId(Long printerId) {
        this.printerId = printerId;
    }

    public Long getPrintType() {
        return printType;
    }

    public void setPrintType(Long printType) {
        this.printType = printType;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }
}
